  <!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Yahoo! UI Library - Drag and Drop</title>
<link rel="stylesheet" type="text/css" href="./css/screen.css">
</head>
  
<script type="text/javascript" src="../../build/yahoo/yahoo-min.js" ></script>
<script type="text/javascript" src="../../build/event/event-min.js" ></script>
<script type="text/javascript" src="../../build/dom/dom-min.js"></script>
<script type="text/javascript" src="../../build/logger/logger-min.js"></script>

<script type="text/javascript" src="../../build/dragdrop/dragdrop-debug.js" ></script>

        <script type="text/javascript" src="js/DDPlayer.js" ></script>
<script type="text/javascript">
YAHOO.example.DDApp = function() {
    var slots = [];
    var players = [];
    var Event = YAHOO.util.Event;
    var DDM = YAHOO.util.DDM;
    return {

        remove: function() {
            players[4].removeFromGroup("bottomslots");
        },

        init: function() {
            
            // slots
            slots[0] = new YAHOO.util.DDTarget("t1", "topslots");
            slots[1] = new YAHOO.util.DDTarget("t2", "topslots");
            slots[2] = new YAHOO.util.DDTarget("b1", "bottomslots");
            slots[3] = new YAHOO.util.DDTarget("b2", "bottomslots");
            slots[4] = new YAHOO.util.DDTarget("b3", "bottomslots");
            slots[5] = new YAHOO.util.DDTarget("b4", "bottomslots");
            
            // players
            players[0] = new YAHOO.example.DDPlayer("pt1", "topslots");
            players[1] = new YAHOO.example.DDPlayer("pt2", "topslots");
            players[2] = new YAHOO.example.DDPlayer("pb1", "bottomslots");
            players[3] = new YAHOO.example.DDPlayer("pb2", "bottomslots");
            players[4] = new YAHOO.example.DDPlayer("pboth1", "topslots");
            players[4].addToGroup("bottomslots");
            players[5] = new YAHOO.example.DDPlayer("pboth2", "topslots");
            players[5].addToGroup("bottomslots");

            DDM.mode = document.getElementById("ddmode").selectedIndex;
        }

    };
} ();

YAHOO.util.Event.addListener(window, "load", YAHOO.example.DDApp.init);
//YAHOO.util.Event.addListener("removeButton", "click", YAHOO.example.DDApp.remove);

</script>
<body>
<div id="pageTitle"><h3>Drag and Drop - DDProxy</h3></div>

  
<style type="text/css">

/* logger default styles */
/* font size is controlled here: default 77% */
#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}
/* width is controlled here: default 31em */
.yui-log {background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;}
.yui-log p {margin:1px;padding:.1em;}
.yui-log button {font-family:monospace;}
.yui-log .yui-log-hd {padding:.5em;background-color:#575757;color:#FFF;}
/* height is controlled here: default 20em*/
.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}
.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;}
.yui-log .yui-log-ft .yui-log-categoryfilters {}
.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}
.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}
.yui-log .yui-log-filtergrp {margin-right:.5em;}
.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */
.yui-log .warn {background-color:#F58516;} /* F58516 orange */
.yui-log .error {background-color:#E32F0B;} /* E32F0B red */
.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */
.yui-log .window {background-color:#F2E886;} /* F2E886 tan */


</style>


<img id="ylogo" src="img/logo.gif" />

<div id="container">
<div id="containerTop">
<div id="header">
<h4>&nbsp;</h4>
</div>
<div id="main">

<div id="rightbar">

<div id="rightBarPad">
<h3>Examples</h3>

<div id="linkage">
<ul>
<li><a href="drag.html?mode=dist">Drag test</a></li>
<li><a href="ontop.html?mode=dist">Always on top</a></li>
<li><a href="proxy.html?mode=dist">Proxy drag</a> </li>
<li><a href="list.html?mode=dist">Sortable list</a> </li>
<!--
<li><a href="slider.html?mode=dist">Slider</a></li>
-->
<li><a href="multihandle.html?mode=dist">Multiple handles</a></li>
<li><a href="targetable.html?mode=dist">Targetable affordance</a></li>
<li><a href="grid.html?mode=dist">Grid</a></li>
<li><a href="resize.html?mode=dist">Resize pane</a></li>
<li><a href="circle.html?mode=dist">Custom click validator</a></li>

</ul>
</div> 



<script type="text/javascript">
//<![CDATA[
    YAHOO.example.logApp =  {

       reader: null,

       init:  function() {
            if (YAHOO.widget.Logger) {
                this.reader = new YAHOO.widget.LogReader( "logDiv", 
                        { newestOnTop: true, height: "400px" } );

                this.reader._onClickPauseBtn(null, this.reader);
            }
        }
    };

    YAHOO.util.Event.on(window, "load", YAHOO.example.logApp.init);

//]]>
</script>

</h4>
<div id="logDiv"></div>
</div>


</div>

  <div id="content">
    <form name="dragDropForm" action="javscript:;">
    <div class="newsItem">
      <h3>Multiple groups, targetable affordance</h3>
      <p> 
        Mode: 
        <select id="ddmode" onchange="YAHOO.util.DDM.mode = this.selectedIndex">
          <option value="0" selected>Point</point>
          <option value="1">Intersect</point>
        </select>
      </p>
<strong>The logger is paused for performance reasons.  Click "Resume" to re-enable it.</strong>
      <div id="workArea">&nbsp;</div>
      <p>
     <!-- 
<input id="removeButton" type="button" value="remove" />
-->
      </p>
    </div>
    </form>
  </div>
    
        <div id="footerContainer">
        <div id="footer">
          <p>&nbsp;</p>
        </div>
      </div>
    </div>
  </div>
</div>


<style type="text/css">
    .slot { border:2px solid #aaaaaa; background-color:#dddddd; color:#666666; text-align:center; position: absolute; width:60px; height:60px; }
    .player { border:2px solid #bbbbbb; color:#eeeeee; text-align:center; position: absolute; width:60px; height:60px; }
    .target { border:2px solid #574188; background-color:#cccccc; text-align:center; position: absolute; width:60px; height:60px; }

    #t1 { left: 90px; top: 167px; }
    #t2 { left: 458px; top: 167px; }
    #b1 { left: 164px; top: 230px; }
    #b2 { left: 238px; top: 230px; }
    #b3 { left: 312px; top: 230px; }
    #b4 { left: 386px; top: 230px; }
    
    #pt1 { background-color:#7E695E; left: 164px; top: 350px; }
    #pt2 { background-color:#7E695E; left: 164px; top: 430px; }
    #pb1 { background-color:#416153; left: 275px; top: 350px; }
    #pb2 { background-color:#416153; left: 275px; top: 430px; }
    #pboth1 { background-color:#552E37; left: 386px; top: 350px; }
    #pboth2 { background-color:#552E37; left: 386px; top: 430px; }
</style>

<div class="slot" id="t1" >1</div>
<div class="slot" id="t2" >2</div>
<div class="slot" id="b1" >3</div>
<div class="slot" id="b2" >4</div>
<div class="slot" id="b3" >5</div>
<div class="slot" id="b4" >6</div>

<div class="player" id="pt1" >1</div>
<div class="player" id="pt2" >2</div>
<div class="player" id="pb1" >3</div>
<div class="player" id="pb2" >4</div>
<div class="player" id="pboth1" >5</div>
<div class="player" id="pboth2" >6</div>


</body>
</html>
